

import Vue from 'vue'
import App from '@/App'
import router from './router/index'

console.log("你妹啊----merchant")
router.beforeEach((to, from, next) => {
    if (!to.matched.some(record => record.meta.noAuth)) {
      if (localStorage.token) return next({
        name: '加载页面',
        replace: true
      });
      return next({
        name: '登录',
        replace: true
      });
    } else {
      next();
    }
})


Vue.use(router);
Vue.config.productionTip = false;
const myApp = new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: {
    App
  }
});
